#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <cstring>
#include <unordered_set>
#include <queue>
#include <algorithm>
using namespace std;
const int N = 2010;
int ti[N];
vector<pair<int, int>>  path[N];

int ret = 0x3f3f3f3f;
int vis[N];
int dp[N];
int main()
{
	int n, m, k, t;
	cin >> n >> m >> k >> t;
	for (int i = 1; i <= n; i++)
		cin >> ti[i];
	queue<int> q;
	vector<int> arr;
	memset(dp, 0x3f3f3f3f, sizeof(dp));
	for (int i = 1; i <= m; i++)
	{
		int num;
		scanf("%d", &num);
		q.push(num);
		vis[num] = 1;
		arr.push_back(num);
		dp[num] = 0;
	}
	for (int i = 0; i < k; i++)
	{
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		path[a].push_back({ b,c });
	}
	while (q.size())
	{
		int k = q.front();
		vis[k] = 1;
		q.pop();
		for (auto& p : path[k])
		{
			int i = p.first;
			int tmp = p.second;
			if (k == i || vis[tmp])
				continue;
			int now = max(ti[k], ti[i]) + max(dp[k], dp[i]);
			dp[tmp] = min(now, dp[tmp]);
			q.push(tmp);
			arr.push_back(tmp);
		}
	}
	cout << dp[t];
	return 0;
}